package cn.piesat.scanning.service.impl;

import cn.piesat.scanning.dao.HtAlgorithmConfigurationDAO;
import cn.piesat.scanning.dto.HtAlgorithmConfigurationDTO;
import cn.piesat.scanning.service.HtAlgorithmConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * 算法信息服务层实现
 * @author xhl
 */
@Service("htAlgorithmConfigurationService")
public class HtAlgorithmConfigurationServiceImpl implements HtAlgorithmConfigurationService {

    @Autowired
    private HtAlgorithmConfigurationDAO htAlgorithmConfigurationDAO;

    /**
     * 根据算法信息ID查询算法信息
     * @param id 算法信息ID
     * @return
     */
    @Override
    public HtAlgorithmConfigurationDTO findById(String id) {
        Optional<HtAlgorithmConfigurationDTO> byId = htAlgorithmConfigurationDAO.findById(id);
        HtAlgorithmConfigurationDTO htAlgorithmConfigurationDTO = byId.get();
        return htAlgorithmConfigurationDTO;
    }
}
